<link href="<?php echo base_url('theme/css/frontend/search.css'); ?>" type="text/css" rel="stylesheet" />
<?php if (isset($company) && $company != "") { ?>
    <div class="header row">
        <div class="title">
            <h1><?php echo $company['name']; ?></h1>
            <div class=info>
                <?php echo $company['address']; ?> <br/>
                <?php if ($company['tax_code']): ?>
                    MST: <?php echo $company['tax_code']; ?> 
                <?php endif; ?>
                ĐT: <?php echo $company['tel']; ?><br/>
                <a href="mailto:<?php echo $company['email']; ?>"><?php echo $company['email']; ?></a><br/>
                <?php if ($company['website']): ?>
                    <?php echo $company['website']; ?>   
                <?php endif; ?>
            </div>
        </div>
        <div class="logo">
            <img style="width:100px; height:110px;" class="img-polaroid" src="<?php echo base_url('upload/company/logo/' . $company['user_id'] . '/' . $company['logo']); ?>">
        </div>
    </div>
    <div class="content row">
        <ul>
        </ul>
        <div class=tabs>
            <div id="tab-1" class="tab" style="display: block;height:460px;overflow:scroll">
                <div id="popup-event-info">
                    <div class="popup-event-info-content">
                        <div class="popup-event-info-content-left">
                            <div class="content">
                                <h4><?php echo $event['name']; ?></h4>
                                <p class="participation"><?php echo $event['count']; ?> người tham gia sự kiện</p>
                                <p class="address"><?php echo $event['address']; ?></p>
                                <p class="date"><?php echo $event['day'] . ": " . $event['time_event']; ?></p>
                                <?php if (isset($current_user) && $current_user == 1) { ?>
                                    <div class="button">
                                        <button class="btn btn-primary btn-event-cancel" type="button" onclick="cancelevent(<?php echo $event['id']; ?>);">
                                            Huỷ
                                        </button>
                                        <button class="btn btn-primary btn-event" name="change" onclick="change(<?php echo $event['id'] . "," . $event['type']; ?>);" value="Sửa đổi">
                                            Sửa đổi
                                        </button>
                                    </div>
                                <?php } else { ?>
                                    <?php if (isset($current_participation) && $current_participation == 1) { ?>
                                        <div class="join-message">Bạn đã đăng ký tham gia sự kiện này.</div>
                                    <?php } else if (isset($current_not_participation) && $current_not_participation == 1) { ?>
                                        <div class="join-message">Bạn đã từ chối tham gia sự kiện này.</div>
                                    <?php } else if(isset($_SESSION['userLoggedIn'])) { ?>
                                        <div class="button"> 
                                            <button class="btn btn-primary btn-event-cancel" name="join" type="button" onclick="join(<?php echo $event['id']; ?>);">
                                                Tham gia
                                            </button>
                                            <button class="btn btn-primary btn-event" name="notjoin" onclick="notjoin(<?php echo $event['id']; ?>);" value="Sửa đổi">
                                                Không tham gia
                                            </button>
                                            <div class="join-message"></div>
                                        </div>
                                    <?php } else if(!isset($_SESSION['userLoggedIn'])) { ?>
                                        <div class="join-message">Bạn cần đăng nhập để tham gia sự kiện này.</div>
                                    <?php } ?>
                                <?php } ?>
                            </div>
                        </div>
                        <div class="popup-event-info-content-right"><img src="<?php echo base_url($event['image']); ?>" /></div>
                        <div class="popup-event-info-content-read">
                            <div class="textcontent">
                                <?php echo nl2br(htmlspecialchars($event['content'])); ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <input type="hidden" name="id" value="<?php echo $event['id']; ?>" />
        </div> 
    </div>
    <div class="footer row">
        <ul class="thumbnails related">
            <?php for ($i = 0; $i < 4; $i++): ?>
                <li>
                    <a class="thumbnail" href="#">
                        <div class="content">
                            <div class="title">Lucidchart: Diagramming</div>
                            <div title="Average rating: 4.31 stars (Liked it)">
                                <div class="rsw-starred"></div>
                                <div class="rsw-starred"></div>
                                <div class="rsw-starred"></div>
                                <div class="rsw-starred"></div>
                                <div class="rsw-unstarred"></div>
                            </div>
                        </div>
                        <div class="avatar">
                            <img width=50 height=50 src="https://lh6.googleusercontent.com/Y1m7gRLdYzRGCmQ47GaBsxjbJKSK99-wohDVbmglgB41Hkn1t5QIOuw69hSIRzuwitBtr-5dsg=s50-h50-e365">
                        </div>
                    </a>
                </li>
            <?php endfor; ?>
        </ul>
    </div>
<?php } else if (isset($booth) && $booth != "") { ?>
    <div class="header row">
        <div class="title">
            <h1><?php echo $booth['name']; ?></h1>
            <div class=info>
                <?php echo $booth['address']; ?> <br/>
                ĐT: <?php echo $booth['tel']; ?><br/>
                <a href="mailto:<?php echo $booth['email']; ?>"><?php echo $booth['email']; ?></a><br/>
                <?php if ($booth['website']): ?>
                    <?php echo $booth['website']; ?>   
                <?php endif; ?>
            </div>
        </div>
        <div class="logo">
            <img style="width:100px; height:110px;" class="img-polaroid" src="<?php echo base_url('upload/booth/avatar/' . $booth['user_id'] . '/' . $booth['avatar']); ?>">
        </div>
    </div>
    <div class="content row">
        <ul>
        </ul>
        <div class=tabs>
            <div id="tab-1" class="tab" style="display: block;">
                <div id="popup-event-info">
                    <div class="popup-event-info-content">
                        <div class="popup-event-info-content-left">
                            <div class="content">
                                <h4><?php echo $event['name']; ?></h4>
                                <p class="participation"><?php echo $event['count']; ?> người tham gia sự kiện</p>
                                <p class="address"><?php echo $event['address']; ?></p>
                                <p class="date"><?php echo $event['day'] . ": " . $event['time_event']; ?></p>
                                <?php if (isset($current_user) && $current_user == 1) { ?>
                                    <div class="button">
                                        <button class="btn btn-primary btn-event-cancel" type="button" onclick="cancelevent(<?php echo $event['id']; ?>);">
                                            Huỷ
                                        </button>
                                        <button class="btn btn-primary btn-event" name="change" onclick="change(<?php echo $event['id'] . "," . $event['type']; ?>);" value="Sửa đổi">
                                            Sửa đổi
                                        </button>
                                    </div>
                                <?php } else { ?>
                                    <?php if (isset($current_participation) && $current_participation == 1) { ?>
                                        <div class="join-message">Bạn đã đăng ký tham gia sự kiện này.</div>
                                    <?php } else if (isset($current_not_participation) && $current_not_participation == 1) { ?>
                                        <div class="join-message">Bạn đã từ chối tham gia sự kiện này.</div>
                                    <?php } else if(isset($_SESSION['userLoggedIn'])) { ?>
                                        <div class="button"> 
                                            <button class="btn btn-primary btn-event-cancel" name="join" type="button" onclick="join(<?php echo $event['id']; ?>);">
                                                Tham gia
                                            </button>
                                            <button class="btn btn-primary btn-event" name="notjoin" onclick="notjoin(<?php echo $event['id']; ?>);" value="Sửa đổi">
                                                Không tham gia
                                            </button>
                                            <div class="join-message"></div>
                                        </div>
                                    <?php } else if(!isset($_SESSION['userLoggedIn'])) { ?>
                                        <div class="join-message">Bạn cần đăng nhập để tham gia sự kiện này.</div>
                                    <?php } ?>
                                <?php } ?>
                            </div>
                        </div>
                        <div class="popup-event-info-content-right"><img src="<?php echo base_url($event['image']); ?>" /></div>
                        <div class="popup-event-info-content-read">
                            <div class="textcontent">
                                <?php echo nl2br(htmlspecialchars($event['content'])); ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <input type="hidden" name="id" value="<?php echo $event['id']; ?>" />
        </div> 
    </div>
    <div class="footer row">
        <ul class="thumbnails related">
            <?php for ($i = 0; $i < 4; $i++): ?>
                <li>
                    <a class="thumbnail" href="#">
                        <div class="content">
                            <div class="title">Lucidchart: Diagramming</div>
                            <div title="Average rating: 4.31 stars (Liked it)">
                                <div class="rsw-starred"></div>
                                <div class="rsw-starred"></div>
                                <div class="rsw-starred"></div>
                                <div class="rsw-starred"></div>
                                <div class="rsw-unstarred"></div>
                            </div>
                        </div>
                        <div class="avatar">
                            <img width=50 height=50 src="https://lh6.googleusercontent.com/Y1m7gRLdYzRGCmQ47GaBsxjbJKSK99-wohDVbmglgB41Hkn1t5QIOuw69hSIRzuwitBtr-5dsg=s50-h50-e365">
                        </div>
                    </a>
                </li>
            <?php endfor; ?>
        </ul>
    </div>
<?php } ?>
